<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    x值:<input type="text" v-model.number="x" @keyup="keyup()"><br>
    y值:<input type="text" v-model.number="y" @blur="blur()"><br>
    <input type="button" @click="calc()" value="计算">
    {{count}}

</div>

<script type="application/javascript">
    var vue = new Vue({
        el:'#app',
        data:{
            x:'',
            y:'',
            count:''
        },
        methods:{
            calc(){
                this.count = this.x+this.y;
            },
            keyup(){
                alert(this.x);
            },
            blur() {
                alert(this.y);
            }
        }
    });


</script>


</body>
</html>